﻿using System.ComponentModel.DataAnnotations;

namespace LogManager.Base.Models.Event.Filter
{
    /// <summary>
    /// Filter that is specifing the source of the events
    /// If a property is null it won't be filtered
    /// </summary>
    public class EventSourceFilter : IEventSource
    {
        /// <summary>
        /// Create a new source filter
        /// </summary>
        public EventSourceFilter()
        {
            ServerName = "All";
            LogName = "All";
        }

        /// <summary>
        /// Create a new source filter
        /// </summary>
        /// <param name="serverName">Name of the server to filter</param>
        /// <param name="logName">Name of the log to filter</param>
        public EventSourceFilter(string serverName,string logName)
        {
            ServerName = serverName;
            LogName = logName;
        }

        /// <summary>
        /// Name of the log
        /// </summary>
        [Display(Name = "Log")]
        public string LogName { get; set; }

        /// <summary>
        /// Name of the server
        /// </summary>
        [Display(Name = "Server")]
        public string ServerName { get; set; }
    }
}